package main

import (
	"fmt"
	"sort"
	"strconv"
	"strings"
)

func main1() {
	var nums string
	var capacity int

	fmt.Scan(&nums)
	fmt.Scan(&capacity)
	var groups []int
	strs := strings.Split(nums, ",")
	for _, str := range strs {
		value, _ := strconv.Atoi(str)
		groups = append(groups, value)
	}
	sort.Slice(groups, func(i, j int) bool {
		return groups[i] < groups[j]
	})
	var dp [100]int
	dp[0] = 1
	for i := 0; i < len(groups); i++ {
		diff := capacity - groups[i]
		for j := diff; j >= 0; j-- {
			dp[j+groups[i]] += dp[j]
		}
	}
	fmt.Println(dp[capacity])

}
